package com.class05;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/servletB")
public class ServletB extends HttpServlet {

    @Override
    public void service(ServletRequest req, ServletResponse res)
            throws ServletException, IOException {
        System.out.println(req.getAttribute("key1"));
        System.out.println("ServletB执行了.............");
//        PrintWriter writer = res.getWriter();
//        res.getWriter().write("<h1>ServletB</h1>");
    }
}
